exports.__esModule = true;

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }

exports.default = class extends think.BaseController {

    /**
     * 获取最新未读通知列表 （最新10条）
     */
    getNotifyListAction() {
        var _this = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const userData = _this.getUser();
            const HomeService = _this.service('home/HomeService');
            const res = yield HomeService.getNotifyList(userData);
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this.json(aj);
        })();
    }

    /**
     * 获取我的待办任务 （最新10条）
     */
    getTaskListAction() {
        var _this2 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const userData = _this2.getUser();
            const HomeService = _this2.service('home/HomeService');
            const res = yield HomeService.getTaskList(userData);
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this2.json(aj);
        })();
    }

    /**
     * 获取进行中项目列表 （最新10条）
     */
    getUnfinishedListAction() {
        var _this3 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const userData = _this3.getUser();
            const HomeService = _this3.service('home/HomeService');
            const res = yield HomeService.getUnfinishedList(userData);
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this3.json(aj);
        })();
    }

    getWorkDetailAction() {
        var _this4 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const data = { proc_inst_id: _this4.get('proc_inst_id') };
            const HomeService = _this4.service('home/HomeService');
            const res = yield HomeService.getWorkDetail(data);
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this4.json(aj);
        })();
    }
    /**
     * 获取问题部件统计
     */
    getQuePartsCountAction() {
        var _this5 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const HomeService = _this5.service('home/HomeService');
            const res = yield HomeService.getQuePartsCount();
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this5.json(aj);
        })();
    }
    /**
     * 获取事件分类统计
     */
    getEventGroupCountAction() {
        var _this6 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const HomeService = _this6.service('home/HomeService');
            const res = yield HomeService.getEventGroupCount();
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this6.json(aj);
        })();
    }

    /**
     * 最近30天案卷统计
     */
    getCaseStateCountAction() {
        var _this7 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const HomeService = _this7.service('home/HomeService');
            const res = yield HomeService.getCaseStateCount();
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this7.json(aj);
        })();
    }
    /**
     * 获取进行中审批
     */
    getCustFormTaskAction() {
        var _this8 = this;

        return _asyncToGenerator(function* () {
            let aj = think.ajaxJson();
            const userData = _this8.getUser();
            const HomeService = _this8.service('home/HomeService');
            const res = yield HomeService.getCustFormTask(userData);
            if (!res.error) {
                aj.result = res;
            } else {
                aj.success = false;
                aj.msg = '查询失败';
            }
            return _this8.json(aj);
        })();
    }

};